<div class="p0 col-xs-12" ng-controller="adminCtrl" ng-init="queryMenuList()">
    <div class="col-xs-12 main-nav">
        <div class="btn-group btn-group-sm r3 fl mr10">
            <a type="button" class="btn btn-default" onclick="history.back(-1);"><i
                    class="iconfont mt-3">&#xe697;&nbsp;</i>后退</a>
            <a type="button" class="btn btn-default" id="refresh" ng-click="queryMenuList(list.page.currentPage)"><i
                    class="iconfont mt-3">&#xe6aa;&nbsp;</i>刷新</a>
            <a type="button" class="btn btn-default btn-sm"
               ng-click="detail('新增菜单',800,'admin/menu/detail.do?id=NULL','&parentId='+$stateParams.parentId +'&type='+$stateParams.type)">
                <i class="iconfont mt-3">&#xe604;</i>&nbsp;新增
            </a>
        </div>

        <div class="form-group w200 fl mb0">
            <label class="sr-only">名称</label>
            <div class="input-group btn-group-xs">
                <div class="input-group-addon main-bg CFFF b0 f12">名称</div>
                <input type="text" autocomplete="off" class="form-control input-sm dis-in-blo w120 bl0" placeholder="名称" id="menuName">
            </div>
        </div>

        <button type="button" class="btn btn-adorn btn-sm fl ml10" ng-click="queryMenuList(1);">
            <i class="iconfont mt-3">&#xe6ac;</i>&nbsp;查询
        </button>
    </div>

    <!-- -->
    <div class="col-xs-12 mt50">
        <div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="$stateParams.parentId=='0'">一级菜单列表</div>
        <div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="$stateParams.parentId!='0'">二级菜单列表</div>

        <div class="col-xs-12 p20 BGFFF">
            <table class="table table-bordered table-hover">
                <thead>
                <tr class="BGEEE">
                    <th class="tc">名称</th>
                    <!-- 一级菜单不显示超链接，二级菜单不显示类型 -->
                    <th class="tc" ng-if="$stateParams.parentId!='0'">超链地址</th>
                    <th class="tc" ng-if="$stateParams.parentId=='0'">类型</th>
                    <td class="tc">排序</td>
                    <th class="w250 tc">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in menus">
                    <td class="tc">{{item.menuName}}</td>
                    <td class="tc" ng-if="$stateParams.parentId!='0'">{{item.menuUrl}}</td>
                    <td class="tc" ng-if="$stateParams.parentId=='0'">{{item.typeName}}</td>
                    <td class="tc">{{item.sequence}}</td>
                    <td class="tc">
                        <a class="f12 text-primary mr10 cursor"
                           ng-click="detail('编辑【'+item.menuName+'】',800,'admin/menu/detail.do?id='+item.id)"
                           data-toggle="tooltip" data-placement="top"
                           data-original-title="编辑"> <i class="iconfont f12">&#xe69e;修改</i>
                        </a>
                        <!-- 菜单只有两级，只有parentId=0的菜单才能查看子菜单 -->
                        <a class="f12 text-primary mr10 cursor"
                           ng-href="#/admin/menu/list?parentId={{item.id}}&menuName={{item.menuName}}"
                           ng-if="item.parentId=='0' && $stateParams.type!='FRIEND' && $stateParams.type!='BOTTOM' && $stateParams.type!='FUNCTION'">
                            <i class="iconfont f12">&#xe699;子菜单</i>
                        </a>
                        <a class="f12 text-danger mr10 cursor" title="删除"
                           ng-click="del('admin/menu/delete.do?id='+item.id,item.menuName)">
                            <i class="iconfont f12">&#xe69d;删除</i>
                        </a>
                    </td>
                </tr>

                </tbody>
            </table>
            <div ui-view="page"></div>
        </div>
    </div>
</div>
<div class="cb"></div>

